<?php
// +----------------------------------------------------------------------
// | 中犇单商户
// +----------------------------------------------------------------------
// | Copyright (c) 2019-2021 中犇科技 All rights reserved.
// +----------------------------------------------------------------------


namespace app\order\validate;

use think\Validate;

/**
 * 快递公司验证器
 * @package app\goods\validate
 * @author 似水星辰 [2630481389@qq.com]
 */
class ExpressCompany extends Validate
{
    //定义规则
    protected $rule = [
        "name|名称"=>["require","chsAlphaNum","min"=>2,"max"=>10],
        "express_no|编码"=>["require","chsAlphaNum","min"=>2,"max"=>10,"unique"=>[ \app\goods\model\ExpressCompany::class,"express_no",null,"aid"]],   
        "tel|电话"=>["require","regex"=>'/^[0-9\-]+$/',"min"=>6,"max"=>16],   
        "logo|LOGO"=>["require","integer","gt"=>0],  
    ];

    protected $message = [
        "tel.regex"=>"电话只能输入数字和横线",
        "logo"=>"LOGO必须上传",
        "express_no.unique"=>"编码已存在",
    ];

    // 定义验证场景
    protected $scene = [
        
    ];
}
